package Bity;

import java.util.PriorityQueue;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int k = in.nextInt();
            PriorityQueue<Integer> queue = new PriorityQueue<>((o1, o2) -> o2 - o1);
            int[] arr = new int[n];
            long count = 0;

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
                if (arr[i] % 2 == 0){
                    queue.offer(arr[i]);
                }
                count += arr[i];
            }
            while (k-- > 0 && !queue.isEmpty()){
                int temp = queue.poll() / 2;
                count -= temp;
                if (temp % 2 == 0){
                    queue.offer(temp);
                }
            }

            System.out.println(count);
        }
    }
}
